package com.zhangtai.modules.service.security;


import com.zhangtai.modules.dto.SecurityRecordDto;
import com.zhangtai.modules.dto.SecurityRecordReportDto;
import com.zhangtai.modules.entity.security.SecurityRecordEntity;
import com.zhangtai.utils.PageResult;
import com.zhangtai.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map;


/**
 * 
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2020-08-17 20:26:04
 */

public interface SecurityRecordService {

    @GetMapping("/findSecurityRecordList")
    @ApiOperation(value = "分页查询")
    PageResult queryPage(@RequestParam(value = "keyword", required = false) String keyword,
                         @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                         @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);



    PageResult<SecurityRecordDto> getRecordList(@RequestParam(value = "time", required = false) String time,
                                                @RequestParam(value = "endTime", required = false) String endTime,
                                                @RequestParam(value = "isCheck", required = false) Integer isCheck,
                                                @RequestParam(value = "isConfirm", required = false) Integer isConfirm,
                                                @RequestParam(value = "type", required = false) Integer type,
                                                @RequestParam(value = "unitName", required = false) String unitName,
                                                @RequestParam(value = "cityName",required = false) String cityName,
                                                @RequestParam(value = "oid", required = false) String oid,
                                                @RequestParam(value = "name",required = false) String name,
                                                @RequestParam(value = "contractGoupIds",required = false) List<Long> contractGoupIds,
                                                @RequestParam(value = "unitId",required = false) Long unitId,
                                                @RequestParam(value = "pageNum",defaultValue = "1" ,required = false) Integer pageNum,
                                                @RequestParam(value = "pageSize",defaultValue = "10" ,required = false) Integer pageSize);


    PageResult<SecurityRecordReportDto> getRecordReportList(@RequestParam(value = "contractIds",required = false) List<Long> contractIds,
            @RequestParam(value = "time", required = false) String time,
                                                            @RequestParam(value = "endTime", required = false) String endTime,
                                                            @RequestParam(value = "isConfirm", required = false) Integer isConfirm,
                                                            @RequestParam(value = "name",required = false) String name,
                                                            @RequestParam(value = "unitName", required = false) String unitName,
                                                            @RequestParam(value = "pageNum",required = false,defaultValue = "1") Integer pageNum,
                                                            @RequestParam(value = "pageSize",required = false,defaultValue = "10") Integer pageSize);



    SecurityRecordEntity getByOidAndType(Long oid,Integer isCheck,String startDay,String endDay);

    void removeUnCheckEntity(Long oid,String startDay,String endDay);

    void deleteAllRecordBySecurityId(Long securityId);

    int getConfirmRecordCount(String securityId,String startTime,String endTime,Integer type);

    @GetMapping("/infoSecurityRecord")
    @ApiOperation(value = "根据id查找")
    SecurityRecordEntity getByIdE(@RequestParam("id") Long id);

    @PostMapping("/saveSecurityRecord")
    @ApiOperation(value = "保存")
    R saveE(@RequestBody SecurityRecordEntity entity);

    @PostMapping("/updateSecurityRecord")
    @ApiOperation(value = "修改")
    R updateByIdE(@RequestBody SecurityRecordEntity entity);

    @GetMapping("/deleteOneSecurityRecord")
    @ApiOperation(value = "根据ID删除")
    R removeOneById(@RequestParam("id") Long id);

    @PostMapping("/deleteSecurityRecords")
    @ApiOperation(value = "根据ID集合删除")
    R removeByIdsE(@RequestBody List<Long> ids);

    List<String> getIdBySecurityId(Long securityId,Integer status);
}

